#ifndef PSSPRAY_H
#define PSSPRAY_H

#include <D3D11.h>
#include <D3DX11.h>
#include <d3dx11effect.h>
#include <xnamath.h>
#include "ParticleSystem.h"


struct Particle 
{
	XMFLOAT3 position;
	XMFLOAT3 velocity;
	float	 life;
};

class PSSpray : public ParticleSystem
{
	public:
		PSSpray();
		virtual ~PSSpray();

		void init(ID3D11Device* g_device, ID3D11DeviceContext* g_context);
		void draw(CXMMATRIX mVP, const XMFLOAT4& pos, float dt);
		void Update(float dt);

		void setHeight(float v); 
		void setActive(bool v) { bActive = v; }

	private:

		float height;

		ID3D11Device*			g_device;
		ID3D11DeviceContext*	g_context;

		ID3D11ShaderResourceView*	srv_alpha;

		ID3D11ShaderResourceView* srv_noise_texture;
		ID3D11Buffer*	vb_particles;
		ID3D11Buffer*	vb_particles_2;

		ID3D11InputLayout*	IA_Spray;
		bool bActive;

		static const int num_particles = 10000;

};



#endif